
clc;

datatype = 'ground-truth';

% Root directory of KTH raw data
rootdir = ['/Users/trananh/Workspace/Python/ua-gesture/data-raw/KTH/' datatype];
if ~strcmp(rootdir(end), '/')
  rootdir = [rootdir '/'];
end

% Path to data file
datafile = ['/Users/trananh/Workspace/Python/ua-gesture/data/KTH/' datatype '/pose-std.mat'];

% Path to pose features dirs
posefeat = ['/Users/trananh/Workspace/Python/ua-gesture/data/KTH/' datatype '/pose-features-std/'];
flowfeat = ['/Users/trananh/Workspace/Python/ua-gesture/data/KTH/' datatype '/flow-features/'];

% Part 1: Load data into .mat file from text file
addpath utils
KTHdata = loadKTHData(rootdir,'skeleton-tracks-std','flow_features_rel');
save(datafile, 'KTHdata');

% Part 2: Extract pose frequency features
addpath pose-frequency
features = 0:14;    % KTH pose features
KTHPoseFrequency(datafile, posefeat, features);

% Part 3: Extract flow frequency features
addpath flow-frequency
% features = 0:15;    % KTH flow features (distribution)
% features = 16:30;   % KTH flow features (magnitude)
features = 0:30;
KTHFlowFrequency(datafile, flowfeat, features);
